export let getYYYYMMDDhhmmss = (datastr) => { //获取年-月-日 时:分:秒时间格式
    let d = new Date(datastr)
    return d.getFullYear() + '-' + mathzero((d.getMonth() + 1)) + '-' + mathzero(d.getDate())+' '+ mathzero(d.getHours()) + ':' +mathzero(d.getMinutes())  + ':' +mathzero(d.getSeconds()) 
}
export let getYYYYMMDD = (datastr) => { //获取年-月-日
    let d = new Date(datastr)
    return d.getFullYear() + '-' + mathzero((d.getMonth() + 1)) + '-' + mathzero(d.getDate())
}

//获取时:分:秒
export let hhmmss=(datastr)=>{
    let d=new Date(datastr)
    return mathzero(d.getHours()) + ':' +mathzero(d.getMinutes())  + ':' +mathzero(d.getSeconds()) 
}
//补0函数
export let mathzero = num => (num < 10 ? '0' + num : num)
import axios from "axios"
//设置服务器基本IP路径
axios.defaults.baseURL='http://127.0.0.1:5000'  //服务器基本路径
export default axios   //暴露axios,只需要暴露一次